package com.lagou.rocketmq.controller;

import com.lagou.rocketmq.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/order/{productId}")
    public boolean secKill(@PathVariable("productId") Integer productId,
                           @RequestParam("userId") Long userId) {

        return orderService.placeOrder(productId, userId);
    }
}
